﻿using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MultipleDB.IRepository.UnitOfWork
{
    /// <summary>
    /// 工作单元
    /// </summary>
    public interface IUnitOfWork
    {
        /// <summary>
        /// 获取DB，保证唯一性
        /// </summary>
        /// <returns></returns>
        SqlSugarScope GetDbClient();
        /// <summary>
        /// 事务开始
        /// </summary>
        void BeginTran();
        /// <summary>
        /// 事务结束
        /// </summary>
        void CommitTran();
        /// <summary>
        /// 事务回滚
        /// </summary>
        void RollbackTran();
    }
}
